<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('yp','center_header'); ?>
<style type="text/css">
#right{margin-top:0px;}
</style>
<div id="main">
<?php include template("yp","center_left"); ?>
  <div id="right">

<script language="javascript">
<!--
function update(x,y,z)
{
$.ajax({
type: "POST",
url: '<?php echo BUSINESSDIR;?>/',
data: "file=map&action=update&x="+x+"&y="+y+"&z="+z,
success: function(msg)
{
if(msg==1)
{
alert('企业地址位置保存成功');
window.location.reload();
}
else
{
alert('操作失败');
}
}	
});
}
//-->
</script>
<script language="javascript" src="http://api.51ditu.com/js/maps.js"></script>
<script language="javascript" src="http://api.51ditu.com/js/ezmarker.js"></script>
<table width="100%"  border="0" cellpadding="5" cellspacing="2" class="table_list">
<th >企业地理位置标注</th>
<input type="hidden" id="x" name="x">
<input type="hidden" id="y" name="y">
<input type="hidden" id="z" name="z">
<tr> 
<td class="tablerow">
<script language="JavaScript">
<!--
    function setMap(point,zoom)
{
var x = point.getLongitude();
var y = point.getLatitude();
        var z = zoom;
update(x,y,z);
}

    var ezmarker = new LTEZMarker("pos");
    LTEvent.addListener(ezmarker,"mark",setMap);//"mark"是标注事件

//-->
</script>
</td>
</tr>
</table><BR>
<?php if($map!='') { ?>
<table width="100%"  border="0" cellpadding="5" cellspacing="2" class="tableborder">
<TR>
<TD>
<div id="maps" style="position:relative; width:100%; height:350px; border:black solid 1px;"> 
   <script language="javascript">
var maps = new LTMaps( "maps" );
var c = new LTSmallMapControl();
maps.addControl(c);
var point = new LTPoint(<?php echo $x;?>,<?php echo $y;?>); 
    maps.centerAndZoom( point, <?php echo $z;?> );
var text=new LTMapText(point,[0,-18]);
text.setLabel( "<?php echo $company_user_infos['companyname'];?>" );
setTimeout("maps.addOverLay( text );",3000);
var icon=new LTIcon("<?php echo $M['url'];?>images/centerPoi.gif",[24,24],[12,12]);
var marker=new LTMarker(new LTPoint(<?php echo $x;?>,<?php echo $y;?>),icon);
maps.addOverLay(marker);
</script>
</div></TD>
</TR>
</TABLE>
<?php } ?>
  </div>
</div>
<div class="clear"></div>
<?php include template('phpcms','footer'); ?>